<script setup lang="ts">
import Dialog from '@/components/Dialog/index.vue'
import { ref } from 'vue'

const emit = defineEmits(['confirm'])
const dialogRef = ref()
const buttons = [
  {
    text: '我知道了',
    type: 'primary',
    onClick: () => {
      emit('confirm')
      dialogRef.value.close()
    },
  },
]

// 打开弹框
function openDialog() {
  dialogRef.value.open()
}

defineExpose({
  openDialog,
})
</script>

<template>
  <Dialog ref="dialogRef" title="提示" :buttons="buttons">
    <template #content-title>
      存在单词未作答
    </template>
    <template #content-sub-title>
      请完成全部单词检查
    </template>
  </Dialog>
</template>
